local list = {}
local data = {}
for _,info in ipairs(load_excel('存档数据.xlsx','通关奖励')) do
    local name = info['名称']
    local title = info['次分类']
    if not data[name] then
        data[name] = {
            name = name,
        }
        table.insert(list,data[name])
    end
    info.tip = ('%s：%s'):format(title,format_obj(info,info['效果']))
    info['属性'] = cd_unpack_attrs(info['效果'],'data')
    table.insert(data[name],info)
end

ac['通关存档'] = list


ac.game:event '玩家-存档读取前'(function(_,player)
    local list = player:get_data('通关数据表') or {}
    local flag = player:get_data('通关成就表') or {}
    for _,info in ipairs(load_excel('存档数据.xlsx','通关奖励')) do
        local hard = info['难度']
        local count = info['次数']
        local sum = list[hard] or 0
        local open = false
        if count>0 then
            if sum>=count then
                open = true
            end
        elseif count==-1 then
            open = flag['完美守护']
        elseif count==-2 then
            open = flag['完美通关']
        elseif count==-3 then
            open = flag['一命通关']
        end
        if open then
            
        end

        if player:is_self() then
            info.open = open
        end
    end
end)




